* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    /* padding: 20px; */
}

.container {
    /* max-width: 1400px; */
    margin: 0 auto;
    background: white;
    /* border-radius: 20px; */
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(90deg, #ff9a9e 0%, #fad0c4 100%);
    color: white;
    padding: 25px 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.content {
    display: flex;
    min-height: 600px;
}

/* 左侧订单区域 */
/* 修改.order-panel样式 */
.order-panel {
    flex: 2;
    background: #f8f9fa;
    /* padding: 15px; */
    border-right: 2px dashed #e0e0e0;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    overflow-y: auto;
}

/* 修改.menu-panel样式 */
.menu-panel {
    flex: 8;
    padding: 30px;
    background: white;
    height: calc(100vh); /* 新增高度限制 */
    overflow-y: auto; /* 新增滚动条 */
}

/* 移除.order-items中的overflow-y */
.order-items {
    flex: 1;
    /* 删除 overflow-y: auto; */
    /* margin-bottom: 20px; */
    
}

.order-item {
    /* 移除 animation 属性 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #ff9a9e;
}

/* 移除动画关键帧和pulse类 */
/* 删除以下代码块：
@keyframes slideIn {...}
@keyframes pulse {...}
.pulse {...}
*/

.item-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.item-info img {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    object-fit: cover;
}

.item-details h3 {
    margin-bottom: 5px;
    color: #333;
}

.item-details p {
    color: #666;
    font-size: 0.9rem;
}

.item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 修改删除按钮样式 */
.delete-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    background: #ff6b6b;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-btn:hover {
    background: #ff4757;
    transform: scale(1.1);
}

/* 移除原有数量按钮样式 */
.quantity-btn {
    display: none;
}

.quantity {
    font-size: 1.2rem;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

/* 修改.order-summary样式 */
.order-summary {
    background: white;
    width: 100%; /* 继承父容器宽度 */
    box-sizing: border-box; /* 包含padding */
    border-radius: 0; /* 去除圆角 */
    padding: 15px;
    box-shadow: 0px -5px 12px 0px rgb(0 0 0 / 30%)
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.total-row {
    font-size: 1.4rem;
    font-weight: bold;
    color: #ff6b6b;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 2px solid #eee;
}

.checkout-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(90deg, #ff9a9e 0%, #fad0c4 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    /* margin-top: 20px; */
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
    /* 移除 flex: 1 保持自然宽度 */
    width: 48%;
    padding: 12px 25px; /* 调整左右内边距 */
    /* 保持原有颜色和渐变 */
}

.checkout-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
}

.checkout-buttons {
    display: flex;
    justify-content: space-between; /* 左右分布 */
    /* margin-top: 20px; */
}

/* 右侧菜单区域 */
.menu-panel {
    flex: 8;
    padding: 30px;
    background: #f8f9fa;
}

.menu-panel h2 {
    color: #4dabf7;
    margin-bottom: 25px;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-categories {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 10px 20px;
    background: #e9ecef;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
}

.category-btn.active,
.category-btn:hover {
    background: #4dabf7;
    color: white;
}

.menu-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.menu-item {
    background: #f8f9fa;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    cursor: pointer;
}

.menu-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.menu-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.menu-item-content {
    padding: 20px;
}

.menu-item-content h3 {
    margin-bottom: 10px;
    color: #333;
}

.menu-item-content p {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 15px;
    min-height: 60px;
}

.item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price {
    font-size: 1.4rem;
    font-weight: bold;
    color: #ff6b6b;
}

.add-btn {
    padding: 8px 16px;
    background: #4dabf7;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-btn:hover {
    background: #339af0;
    transform: scale(1.05);
}

.empty-order {
    text-align: center;
    padding: 40px 0;
    color: #999;
}

.empty-order i {
    font-size: 5rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-order p {
    font-size: 1.2rem;
}

/* 动画效果 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 0.5s ease;
}

/* 响应式设计 */
@media (max-width: 900px) {
    .content {
        flex-direction: column;
    }

    .order-panel {
        border-right: none;
        border-bottom: 2px dashed #e0e0e0;
    }
}

.order-panel {
    /* 保持现有样式不变 */
    display: flex;
    flex-direction: column;
    height: calc(100vh);
    overflow-y: auto;
    background: #f5f7fa;
    position: relative;
    box-shadow: 4px 0 8px rgba(0,0,0,0.1); /* 新增右侧阴影 */
    z-index: 1; /* 确保阴影覆盖在菜单面板上 */
}

.order-items {
    flex: 1;  /* 占据剩余空间 */
    overflow-y: auto;  /* 恢复滚动条 */
    /* margin-bottom: 20px; */
    margin-left: 10px;
    margin-right: 10px;
}

.order-summary {
    /* 保持现有样式基础上添加 */
    position: sticky;
    bottom: 0;
    background: white;
    z-index: 1;
    margin-top: auto; /* 关键属性：将摘要推到底部 */
}

#orderTitle {
    margin: 15px;
}

.menu-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); /* 减小最小宽度从200px到180px */
    gap: 15px; /* 减小间距从25px到15px */
}

.menu-item {
    /* 调整卡片内边距和图片高度 */
    background: #ffffff;
    border-radius: 12px; /* 减小圆角 */
}

.menu-item img {
    height: 130px; /* 缩小图片高度 */
}

.menu-item-content {
    padding: 12px; /* 减小内边距 */
}

@media (max-width: 900px) {
    .menu-items {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); /* 移动端更紧凑 */
        gap: 12px;
    }
}

.order-panel {
    flex: 0 0 350px; /* 固定宽度400px */
}

.menu-panel {
    flex: 1; /* 自动填充剩余空间 */
}

.print-btn {
    background: #4dabf7;
}

.order-item {
    padding: 8px; /* 减少内边距 */
    margin-bottom: 8px; /* 缩小间距 */
    border-left: 2px solid #ff9a9e; /* 减细左侧边框 */
}

.item-info img {
    width: 40px; /* 缩小图片尺寸 */
    height: 40px; /* 缩小图片尺寸 */
}

.item-details h3 {
    font-size: 0.9rem; /* 调小标题字号 */
    margin-bottom: 3px; /* 减少间距 */
    color: #444; /* 调浅颜色 */
}

.item-details p {
    font-size: 0.8rem; /* 调小描述字号 */
    color: #888; /* 调浅颜色 */
}

.delete-btn {
    width: 28px; /* 缩小按钮尺寸 */
    height: 28px; /* 缩小按钮尺寸 */
}

/* 删除按钮图标 */

.trash-icon {
    fill: currentColor;
    width: 16px;
    height: 16px;
}

/* 购物篮图标 */
.basket-icon {
    fill: #ccc;
    width: 48px;
    height: 48px;
    margin-bottom: 15px;
}

/* 添加按钮图标 */
.add-icon {
    fill: white;
    width: 14px;
    height: 14px;
    margin-right: 4px;
}

/* 在现有样式后添加 */
.menu-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-gear {
    margin-left: auto;
    padding-left: 10px;
    color: inherit;
    text-decoration: none;
    transition: opacity 0.3s;
}

.admin-gear:hover {
    opacity: 0.8;
}

.admin-gear {
    margin-left: auto;
    padding-left: 10px;
    color: inherit;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
    transform-origin: center;
}

.admin-gear:hover {
    opacity: 0.8;
    transform: scale(1.1) rotate(15deg); /* 添加缩放和旋转动画 */
}

.admin-gear svg {
    transition: all 0.3s ease-in-out;
    filter: drop-shadow(0 2px 4px rgba(77, 171, 247, 0.3)); /* 添加浅蓝色投影 */
}

.admin-gear:hover svg {
    filter: drop-shadow(0 3px 6px rgba(77, 171, 247, 0.5)); /* 悬停时增强投影 */
    animation: gear-spin 1.5s ease-in-out infinite; /* 添加持续旋转动画 */
}

@keyframes gear-spin {
    0%, 100% { transform: rotate(0deg); }
    30% { transform: rotate(15deg); }
    70% { transform: rotate(-15deg); }
}

.clear-btn {
    background: #ff4757;
}